import request from '@/utils/request'
// 对话
export function chat(data) {
  return request({
    url: '/xiaozhi/chat',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 流式对话
export function streamChat(data, progressHandler) {
  return request({
    url: '/xiaozhi/streamChat',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data,
    responseType: 'text',
    timeout: 120000, // 设置为120秒
    onDownloadProgress: progressHandler
  })
}
